﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Simulacion.Fruits
{
    public class Lemon : Fruit
    {
        private double pLowA, pLowB, pJulMi, pJulSigma, pHighMi, pHighSigma;

        public Lemon()
        {
            _life = 14;
            this.pLowA = -0.28942;
            this.pLowB = 1.6894;
            this.pJulMi = 0.89583;
            this.pJulSigma = 0.80529;
            this.pHighMi = 1.125;
            this.pHighSigma = 0.94696;

            this._pLowMin = pLowA;
            this._pLowMax = pLowB;
            this._pHighMin = 0.2;
            this._pHighMax = 3;
            this._pJulMin = 0.2;
            this._pJulMax = 3.0;
        }

        protected override double GetVarPeriodLow()
        {
            return Distributions.Uniform.GetDistributionValue(pLowA, pLowB);
        }

        protected override double GetVarPeriodHigh()
        {
            return Distributions.Normal.GetDistributionValue(_pHighMin, _pHighMax, pHighMi, pHighSigma);
        }

        protected override double GetVarPeriodJuly()
        {
            return Distributions.Normal.GetDistributionValue(_pJulMin, _pJulMax, pJulMi, pJulSigma);
        }

        protected override double GetFPeriodLow(double x)
        {
            return Distributions.Uniform.fUniform(pLowA, pLowB);
        }

        protected override double GetFPeriodHigh(double x)
        {
            return Distributions.Normal.fNormal(x, pHighMi, pHighSigma);
        }

        protected override double GetFPeriodJuly(double x)
        {
            return Distributions.Normal.fNormal(x, pJulMi, pJulSigma);
        }

        public double PLowA
        {
            get { return pLowA; }
            set { pLowA = value; }
        }

        public double PLowB
        {
            get { return pLowB; }
            set { pLowB = value; }
        }

        public double PJulMi
        {
            get { return pJulMi; }
            set { pJulMi = value; }
        }

        public double PJulSigma
        {
            get { return pJulSigma; }
            set { pJulSigma = value; }
        }

        public double PHighMi
        {
            get { return pHighMi; }
            set { pHighMi = value; }
        }

        public double PHighSigma
        {
            get { return pHighSigma; }
            set { pHighSigma = value; }
        }
    }
}
